<?php

 /**
  * @package JooS
  * @subpackage PHPackager
  */

  require_once "JooS/PHPackager/DOM/Element.php";

  class JooS_PHPackager_DOM_Element_Control extends JooS_PHPackager_DOM_Element {
    const PROJECT_NODE_NAME = "package";

    /**
     * @var array
     */
    private $_projects = null;

    /**
     * @return JooS_PHPackager_DOM_Element_Control
     */
    public function make() {
      $this->_projects = $this->query(self::PROJECT_NODE_NAME);
      foreach ($this->_projects as $project)
        $project->make();

      return $this;
    }

    /**
     * @return JooS_PHPackager_DOM_Element_Control
     */
    public function install() {
      foreach ($this->_projects as $project)
        $project->install();

      return $this;
    }
  }
